﻿using BestCode.Creds.Entities;
using NHibernate.Mapping.ByCode;
using NHibernate.Mapping.ByCode.Conformist;
using NHibernate.Type;

namespace BestCode.Creds.Data.Mappings
{
    public class AttachmentMapping : ClassMapping<Attachment>
    {
        public AttachmentMapping()
        {
            Id(p => p.Id, map =>
            {
                map.Column("AttachmentId");
                map.Generator(Generators.Identity);
            });
            Property(p => p.FileName);
            
            Property(p => p.ExtensionType);

            Property(p => p.MediaContent, map => map.Type<BinaryBlobType>());
            
        }
    }
}
